//
//  ShopAdornGoodsTableViewCell.m
//  ForestPack
//
//  Created by 郑洲 on 2018/7/17.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "ShopAdornGoodsTableViewCell.h"

@interface ShopAdornGoodsTableViewCell ()

@property (nonatomic, strong) UIImageView *headImage;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *detailLabel;
@property (nonatomic, strong) UILabel *moneyLabel;

@end

@implementation ShopAdornGoodsTableViewCell

+ (ShopAdornGoodsTableViewCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellID = @"ShopAdornGoodsTableViewCell";
    ShopAdornGoodsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[ShopAdornGoodsTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        [cell createSubView];
    }
    
    return cell;
}

- (void)createSubView {
    self.headImage = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenX375(13), ScreenX375(15), ScreenX375(103), ScreenX375(71))];
    self.headImage.layer.cornerRadius = ScreenX375(5);
    self.headImage.clipsToBounds = YES;
    self.headImage.image = [UIImage imageNamed:@"头部背景"];
    [self addSubview:self.headImage];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(126), ScreenX375(14), ScreenX375(200), ScreenX375(16))];
    self.nameLabel.text = @"纸箱纸板";
    self.nameLabel.textColor = REXADECIMALCOLOR(@"#333333");
    self.nameLabel.font = Kfont(14);
    [self addSubview:self.nameLabel];
    
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(126), ScreenX375(35), ScreenX375(200), ScreenX375(18))];
    self.detailLabel.textColor = REXADECIMALCOLOR(@"#999999");
    self.detailLabel.font = Kfont(12);
    self.detailLabel.text = @"成交2243笔 | 服务评分：4.98分";
    [self addSubview:self.detailLabel];
    
    self.moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(126), ScreenX375(72), ScreenX375(200), ScreenX375(18))];
    self.moneyLabel.textColor = ThemeColor;
    self.moneyLabel.font = Kfont(14);
    self.moneyLabel.text = @"1200元";
    [self addSubview:self.moneyLabel];
    
    UIImageView *sLine = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenX375(13), ScreenX375(101) - 0.5, SCREEN_WIDTH - ScreenX375(26), 0.5)];
    sLine.image = [UIImage imageNamed:@"虚线"];
    [self addSubview:sLine];
}

@end
